<template>
  <!-- <h1>年审</h1> -->
  <div class="frame">
    <div class="app" v-for="item in bookList" :key="item">
      <div class="tu">
        <div>
          <img :src="$store.state.imgs + item.pictureUrl" alt="" />
        </div>
      </div>
      <div class="demo-fit">
        <div v-for="dmlist in item.dmList" :key="dmlist" class="block">
          <p
            class="box"
            style="border-radius: 50%; width: 0.5rem; height: 0.5rem"
            :fit="fits"
          >
            <img :src="ui" alt="" />
          </p>
          <span class="title">{{ dmlist.nickName }}</span>
        </div>
        <div class="joinBox">
          <router-link :to="'/details/' + item.id">
            <button class="join">立即加入</button>
          </router-link>

          <p>4位DM等待中</p>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import API from "@/api";
export default {
  data() {
    return {
      imgs: require("@/assets/images/Home_Script Recommendation1_Script.png"),
      fits: ["头像", "头像", "头像", "头像"],
      ui: "https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64",
      bookList: [],
    };
  },
  created() {
    this.getFindBook();
  },
  methods: {
    getFindBook() {
      API.getFindBook().then(({ data }) => {
        this.bookList = data.data;
      });
    },
  },
};
</script>

<style>
.frame {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}
.app {
  width: 3.72rem;
  height: 2.42rem;
  box-sizing: border-box;
  padding: 0 0 0 0.2rem;
  background: #ffffff;
  box-shadow: 0px 0.04rem 0.2rem rgba(0, 0, 0, 0.1);
}
.tu {
  padding-top: 0.1rem;
}
.tu img {
  width: 3.3rem;
  height: 1.5rem;
  border-radius: 0.1rem;
}
.demo-fit {
  display: flex;
  text-align: center;
  justify-content: space-around;
}
.demo-fit .block {
  flex: 1;
  display: flex;
  flex-direction: column;
  flex-grow: 0;
  margin-top: 0.05rem;
}

.demo-fit .title {
  font-size: 0.11rem;
}
.joinBox {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
}
.joinBox,
p {
  font-size: 0.1rem;
  margin-bottom: 0.05rem;
  margin-right: 0.05rem;
  color: #666666;
}
.join {
  margin-top: 0.15rem;
  width: 0.79rem;
  height: 0.25rem;
  font-size: 0.12rem;
  background-color: #b56cff;
  margin-right: 0.1rem;
  border-radius: 0.2rem;
  color: #fff;
}
.box img {
  width: 0.5rem;
  border-radius: 50%;
  margin-left: 0.05rem;
}
</style>
